﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class UnityEngineTextCoreGlyphWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(UnityEngine.TextCore.Glyph);
			Utils.BeginObjectRegister(type, L, translator, 0, 1, 5, 5);
			
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "Compare", _m_Compare);
			
			
			Utils.RegisterFunc(L, Utils.GETTER_IDX, "index", _g_get_index);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "metrics", _g_get_metrics);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "glyphRect", _g_get_glyphRect);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "scale", _g_get_scale);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "atlasIndex", _g_get_atlasIndex);
            
			Utils.RegisterFunc(L, Utils.SETTER_IDX, "index", _s_set_index);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "metrics", _s_set_metrics);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "glyphRect", _s_set_glyphRect);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "scale", _s_set_scale);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "atlasIndex", _s_set_atlasIndex);
            
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
			
			
            
			
			
			
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 1)
				{
					
					var gen_ret = new UnityEngine.TextCore.Glyph();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 2 && translator.Assignable<UnityEngine.TextCore.Glyph>(L, 2))
				{
					UnityEngine.TextCore.Glyph _glyph = (UnityEngine.TextCore.Glyph)translator.GetObject(L, 2, typeof(UnityEngine.TextCore.Glyph));
					
					var gen_ret = new UnityEngine.TextCore.Glyph(_glyph);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable<UnityEngine.TextCore.GlyphMetrics>(L, 3) && translator.Assignable<UnityEngine.TextCore.GlyphRect>(L, 4))
				{
					uint _index = LuaAPI.xlua_touint(L, 2);
					UnityEngine.TextCore.GlyphMetrics _metrics;translator.Get(L, 3, out _metrics);
					UnityEngine.TextCore.GlyphRect _glyphRect;translator.Get(L, 4, out _glyphRect);
					
					var gen_ret = new UnityEngine.TextCore.Glyph(_index, _metrics, _glyphRect);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 6 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable<UnityEngine.TextCore.GlyphMetrics>(L, 3) && translator.Assignable<UnityEngine.TextCore.GlyphRect>(L, 4) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 6))
				{
					uint _index = LuaAPI.xlua_touint(L, 2);
					UnityEngine.TextCore.GlyphMetrics _metrics;translator.Get(L, 3, out _metrics);
					UnityEngine.TextCore.GlyphRect _glyphRect;translator.Get(L, 4, out _glyphRect);
					float _scale = (float)LuaAPI.lua_tonumber(L, 5);
					int _atlasIndex = LuaAPI.xlua_tointeger(L, 6);
					
					var gen_ret = new UnityEngine.TextCore.Glyph(_index, _metrics, _glyphRect, _scale, _atlasIndex);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
			}
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.TextCore.Glyph constructor!");
            
        }
        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_Compare(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.TextCore.Glyph gen_to_be_invoked = (UnityEngine.TextCore.Glyph)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    UnityEngine.TextCore.Glyph _other = (UnityEngine.TextCore.Glyph)translator.GetObject(L, 2, typeof(UnityEngine.TextCore.Glyph));
                    
                        var gen_ret = gen_to_be_invoked.Compare( _other );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_index(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.TextCore.Glyph gen_to_be_invoked = (UnityEngine.TextCore.Glyph)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushuint(L, gen_to_be_invoked.index);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_metrics(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.TextCore.Glyph gen_to_be_invoked = (UnityEngine.TextCore.Glyph)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.metrics);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_glyphRect(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.TextCore.Glyph gen_to_be_invoked = (UnityEngine.TextCore.Glyph)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.glyphRect);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_scale(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.TextCore.Glyph gen_to_be_invoked = (UnityEngine.TextCore.Glyph)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushnumber(L, gen_to_be_invoked.scale);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_atlasIndex(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.TextCore.Glyph gen_to_be_invoked = (UnityEngine.TextCore.Glyph)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.atlasIndex);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_index(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.TextCore.Glyph gen_to_be_invoked = (UnityEngine.TextCore.Glyph)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.index = LuaAPI.xlua_touint(L, 2);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_metrics(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.TextCore.Glyph gen_to_be_invoked = (UnityEngine.TextCore.Glyph)translator.FastGetCSObj(L, 1);
                UnityEngine.TextCore.GlyphMetrics gen_value;translator.Get(L, 2, out gen_value);
				gen_to_be_invoked.metrics = gen_value;
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_glyphRect(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.TextCore.Glyph gen_to_be_invoked = (UnityEngine.TextCore.Glyph)translator.FastGetCSObj(L, 1);
                UnityEngine.TextCore.GlyphRect gen_value;translator.Get(L, 2, out gen_value);
				gen_to_be_invoked.glyphRect = gen_value;
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_scale(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.TextCore.Glyph gen_to_be_invoked = (UnityEngine.TextCore.Glyph)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.scale = (float)LuaAPI.lua_tonumber(L, 2);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_atlasIndex(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.TextCore.Glyph gen_to_be_invoked = (UnityEngine.TextCore.Glyph)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.atlasIndex = LuaAPI.xlua_tointeger(L, 2);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 0;
        }
        
		
		
		
		
    }
}
